import React, { Component } from 'react'
import axios from "axios"
 class Fenye extends Component {
     state = {
         kong:[]
     }
    componentDidMount(){
        axios.get("/list").then(res=>{
             let arr1 = [];
             for(let i = 1;i<=Math.ceil(res.data.list.length/5);i++){
                 arr1.push(i)
             }
            this.setState({
                kong:arr1
              //   kong.length = this.state.total
            })
          //   this.state.kong.length = this.state.total
          //   console.log(this.state.kong.length);
        })
    }
  render() {
    return (
      <div>
            {
            
            this.state.kong.length?this.state.kong.map((item,index)=>{
                return <span onClick={this.checkPage.bind(this,item)}>{item}</span>
            }):"暂无fenye"
        }
      </div>
    )
  }
}

export default Fenye